home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 2000 November: Tool Chest / Dev.CD Nov 00 TC Disk 1.toast / Sample Code / Archive / Networking / OTTCPWillDial / Network Setup SDK Bits / NetworkSetup.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-09-28  |  21.6 KB  |  667 lines  |  [TEXT/MPS ]

  1. #ifndef __NETWORKSETUP__
  2. #define __NETWORKSETUP__
  3.  
  4. #ifndef __NETWORKSETUPTYPES__
  5. #include <NetworkSetupTypes.h>
  6. #endif
  7.  
  8.  
  9.  
  10. #if PRAGMA_ONCE
  11. #pragma once
  12. #endif
  13.  
  14. #ifdef __cplusplus
  15. extern "C" {
  16. #endif
  17.  
  18. #if PRAGMA_IMPORT
  19. #pragma import on
  20. #endif
  21.  
  22. #if PRAGMA_STRUCT_ALIGN
  23.     #pragma options align=mac68k
  24. #elif PRAGMA_STRUCT_PACKPUSH
  25.     #pragma pack(push, 2)
  26. #elif PRAGMA_STRUCT_PACK
  27.     #pragma pack(2)
  28. #endif
  29.  
  30. /*******************************************************************************
  31. **    Configuration Information Access API 
  32. ********************************************************************************/
  33. /*    -------------------------------------------------------------------------
  34.     Database access
  35.     ------------------------------------------------------------------------- */
  36. EXTERN_API( OSStatus )
  37. OTCfgOpenDatabase                (CfgDatabaseRef *        dbRef);
  38.  
  39. /*
  40.     OTCfgOpenDatabase()
  41.  
  42.     Inputs:        none
  43.     Outputs:    CfgDatabaseRef* dbRef            Reference to opened database
  44.     Returns:    OSStatus                        *** list errors ***
  45.  
  46.     Opens the Configuration API for a given client. This call should be made prior to any other call.
  47. */
  48. EXTERN_API( OSStatus )
  49. OTCfgCloseDatabase                (CfgDatabaseRef *        dbRef);
  50.  
  51. /*
  52.     OTCfgCloseDatabase()
  53.  
  54.     Inputs:        CfgDatabaseRef* dbRef            Reference to opened database
  55.     Outputs:    CfgDatabaseRef* dbRef            Reference to opened database is cleared
  56.     Returns:    OSStatus                        *** list errors ***
  57.  
  58.     Closes the Configuration API for a given client. This call should be made when the client no 
  59.     longer wants to use the Configuration API.  
  60. */
  61. /*    -------------------------------------------------------------------------
  62.     Area management
  63.     ------------------------------------------------------------------------- */
  64. EXTERN_API( OSStatus )
  65. OTCfgGetAreasCount                (CfgDatabaseRef         dbRef,
  66.                                  ItemCount *            itemCount);
  67.  
  68. /*
  69.     OTCfgGetAreasCount()
  70.  
  71.     Inputs:        CfgDatabaseRef dbRef            Reference to opened database
  72.     Outputs:    ItemCount* itemCount            Number of entities defined
  73.     Returns:    OSStatus                        *** list errors ***
  74.  
  75.     Returns the number of areas currently defined.
  76. */
  77. EXTERN_API( OSStatus )
  78. OTCfgGetAreasList                (CfgDatabaseRef         dbRef,
  79.                                  ItemCount *            itemCount,
  80.                                  CfgAreaID                 areaID[],
  81.                                  Str255                 areaName[]);
  82.  
  83. /*
  84.     OTCfgGetAreasList()
  85.  
  86.     Inputs:        CfgDatabaseRef dbRef            Reference to opened database
  87.                 ItemCount* itemCount            Number of entities requested
  88.     Outputs:    ItemCount* itemCount            Number of entities defined
  89.     Returns:    OSStatus                        *** list errors ***
  90.  
  91.     Returns a list of area IDs and names. On entry, count should be set to whatever OTCfgGetAreasCount 
  92.     returned.  On exit, count contains the actual number of areas found. This can be less than the 
  93.     initial count value if areas were deleted in the meantime.  The id and name parameters are stored 
  94.     in arrays that should each be able to contain count values.
  95. */
  96. EXTERN_API( OSStatus )
  97. OTCfgGetCurrentArea                (CfgDatabaseRef         dbRef,
  98.                                  CfgAreaID *            areaID);
  99.  
  100. /*
  101.     OTCfgGetCurrentArea()
  102.  
  103.     Inputs:        CfgDatabaseRef dbRef            Reference to opened database
  104.     Outputs:    CfgAreaID* areaID                ID of current area
  105.     Returns:    OSStatus                        *** list errors ***
  106.  
  107.     Returns the id of the current area.
  108. */
  109. EXTERN_API( OSStatus )
  110. OTCfgSetCurrentArea                (CfgDatabaseRef         dbRef,
  111.                                  CfgAreaID                 areaID);
  112.  
  113. /*
  114.     OTCfgSetCurrentArea()
  115.  
  116.     Inputs:        CfgDatabaseRef dbRef            Reference to opened database
  117.                 CfgAreaID areaID                ID of area to make active
  118.     Outputs:    none
  119.     Returns:    OSStatus                        *** list errors ***
  120.  
  121.     Sets the current area. If the area doesn’t exist kCfgAreaNotFoundErr is returned.
  122. */
  123. EXTERN_API( OSStatus )
  124. OTCfgCreateArea                    (CfgDatabaseRef         dbRef,
  125.                                  ConstStr255Param         areaName,
  126.                                  CfgAreaID *            areaID);
  127.  
  128. /*
  129.     OTCfgCreateArea()
  130.  
  131.     Inputs:        CfgDatabaseRef dbRef            Reference to opened database
  132.                 ConstStr255Param areaName        Name of area to create
  133.     Outputs:    CfgAreaID* areaID                ID of newly created area
  134.     Returns:    OSStatus                        *** list errors ***
  135.  
  136.     Creates a new area with the specified name. Then name must be unique or kCfgAreaAlreadyExistsErr 
  137.     will be returned.
  138. */
  139. EXTERN_API( OSStatus )
  140. OTCfgDeleteArea                    (CfgDatabaseRef         dbRef,
  141.                                  CfgAreaID                 areaID);
  142.  
  143. /*
  144.     OTCfgDeleteArea()
  145.  
  146.     Inputs:        CfgDatabaseRef dbRef            Reference to opened database
  147.                 CfgAreaID areaID                ID of area to delete
  148.     Outputs:    none
  149.     Returns:    OSStatus                        *** list errors ***
  150.  
  151.     Deletes the specified area. If the area doesn’t exist kCfgAreaNotFoundErr is returned.
  152. */
  153. EXTERN_API( OSStatus )
  154. OTCfgDuplicateArea                (CfgDatabaseRef         dbRef,
  155.                                  CfgAreaID                 sourceAreaID,
  156.                                  CfgAreaID                 destAreaID);
  157.  
  158. /*
  159.     OTCfgDuplicateArea()
  160.  
  161.     Inputs:        CfgDatabaseRef dbRef            Reference to opened database
  162.                 CfgAreaID sourceAreaID            Area to duplicate
  163.                 CfgAreaID destAreaID            Area to contain duplicate
  164.     Outputs:    none
  165.     Returns:    OSStatus                        *** list errors ***
  166.  
  167.     Duplicates the source area content into the destination area. Both areas should exist prior to 
  168.     making this call. If either area doesn’t exist kCfgAreaNotFoundErr is returned.
  169. */
  170. EXTERN_API( OSStatus )
  171. OTCfgSetAreaName                (CfgDatabaseRef         dbRef,
  172.                                  CfgAreaID                 areaID,
  173.                                  ConstStr255Param         areaName,
  174.                                  CfgAreaID *            newAreaID);
  175.  
  176. /*
  177.     OTCfgSetAreaName()
  178.  
  179.     Inputs:        CfgDatabaseRef dbRef            Reference to opened database
  180.                 CfgAreaID areaID                ID of area being named
  181.                 ConstStr255Param areaName            New name for area
  182.     Outputs:    CfgAreaID* newAreaID            ID of renamed area
  183.     Returns:    OSStatus                        *** list errors ***
  184.  
  185.     Renames the specified area. A new id is returned: it should be used from now on. If the area 
  186.     doesn’t exist kCfgAreaNotFoundErr is returned.
  187. */
  188. /*    -------------------------------------------------------------------------
  189.     Configuration Database API
  190.     
  191.     Single Writer ONLY!!!
  192.     ------------------------------------------------------------------------- */
  193. /*    -------------------------------------------------------------------------
  194.     Opening an area for reading
  195.     ------------------------------------------------------------------------- */
  196. EXTERN_API( OSStatus )
  197. OTCfgOpenArea                    (CfgDatabaseRef         dbRef,
  198.                                  CfgAreaID                 areaID);
  199.  
  200. /*
  201.     OTCfgOpenArea()
  202.  
  203.     Inputs:        CfgDatabaseRef dbRef            Reference to opened database
  204.                 CfgAreaID areaID                ID of area to open
  205.     Outputs:    none
  206.     Returns:    OSStatus                        *** list errors ***
  207.  
  208.     Opens the specified area for reading. If the area doesn’t exist kCfgAreaNotFoundErr is returned.
  209. */
  210. EXTERN_API( OSStatus )
  211. OTCfgCloseArea                    (CfgDatabaseRef         dbRef,
  212.                                  CfgAreaID                 areaID);
  213.  
  214. /*
  215.     OTCfgCloseArea()
  216.  
  217.     Inputs:        CfgDatabaseRef dbRef            Reference to opened database
  218.                 CfgAreaID areaID                ID of area to close
  219.     Outputs:    none
  220.     Returns:    OSStatus                        *** list errors ***
  221.  
  222.     Closes an area opened for reading. If the area doesn’t exist kCfgAreaNotFoundErr is returned.  
  223.     Opening an area for writing All modifications to an area should be performed as part of a 
  224.     transaction.
  225. */
  226. /*
  227.     For write access
  228. */
  229. EXTERN_API( OSStatus )
  230. OTCfgBeginAreaModifications        (CfgDatabaseRef         dbRef,
  231.                                  CfgAreaID                 readAreaID,
  232.                                  CfgAreaID *            writeAreaID);
  233.  
  234. /*
  235.     OTCfgBeginAreaModifications()
  236.  
  237.     Inputs:        CfgDatabaseRef dbRef            Reference to opened database
  238.                 CfgAreaID readAreaID            ID of area opened for reading
  239.     Outputs:    CfgAreaID* writeAreaID            ID of area opened for modification
  240.     Returns:    OSStatus                        *** list errors ***
  241.  
  242.     Opens the specified area for writing. A new area id is provided.  This area id should be used to 
  243.     enumerate, add, delete, read and write to the modified data. The original id can still be used to 
  244.     access the original unmodified data. If the area doesn’t exist kCfgAreaNotFoundErr is returned.
  245. */
  246. EXTERN_API( OSStatus )
  247. OTCfgCommitAreaModifications    (CfgDatabaseRef         dbRef,
  248.                                  CfgAreaID                 readAreaID,
  249.                                  CfgAreaID                 writeAreaID);
  250.  
  251. /*
  252.     OTCfgCommitAreaModifications()
  253.  
  254.     Inputs:        CfgDatabaseRef dbRef            Reference to opened database
  255.                 CfgAreaID readAreaID            ID of area opened for reading
  256.                 CfgAreaID writeAreaID            ID of area opened for modification
  257.     Outputs:    none
  258.     Returns:    OSStatus                        *** list errors ***
  259.  
  260.     Closes an area opened for writing.  All modifications are committed and readers are informed that 
  261.     the database changed state ( kCfgStateChangedErr ). The areaID should be the id of the original 
  262.     area.  If the area doesn’t exist or the wrong id is passed, kCfgAreaNotFoundErr is returned.
  263. */
  264. EXTERN_API( OSStatus )
  265. OTCfgAbortAreaModifications        (CfgDatabaseRef         dbRef,
  266.                                  CfgAreaID                 readAreaID);
  267.  
  268. /*
  269.     OTCfgAbortAreaModifications()
  270.  
  271.     Inputs:        CfgDatabaseRef dbRef            Reference to opened database
  272.                 CfgAreaID readAreaID            ID of area opened for reading
  273.     Outputs:    none
  274.     Returns:    OSStatus                        *** list errors ***
  275.  
  276.     Closes an area opened for writing, discarding any modification. The areaID should be the id of 
  277.     the original area. If the area doesn’t exist or the wrong id is passed kCfgAreaNotFoundErr is 
  278.     returned.
  279. */
  280. /*
  281.     Working with entities
  282.  
  283.     Entities can be manipulated as soon as an area has been opened.  The same calls work both for 
  284.     areas opened for reading or for modification. In the latter case, the calls can be used on the 
  285.     original or new area id to access the original data or the modified data.
  286. */
  287. /*
  288.     For everybody
  289.     Count receives the actual number of entities
  290. */
  291. EXTERN_API( OSStatus )
  292. OTCfgGetEntitiesCount            (CfgDatabaseRef         dbRef,
  293.                                  CfgAreaID                 areaID,
  294.                                  CfgEntityClass         entityClass,
  295.                                  CfgEntityType             entityType,
  296.                                  ItemCount *            itemCount);
  297.  
  298. /*
  299.     OTCfgGetEntitiesCount()
  300.  
  301.     Inputs:        CfgDatabaseRef dbRef            Reference to opened database
  302.                 CfgAreaID areaID                ID of area to count
  303.                 CfgEntityClass entityClass        Class of entities to count
  304.                 CfgEntityType entityType        Type of entities to count
  305.     Outputs:    ItemCount* itemCount            Count of matching entities
  306.     Returns:    OSStatus                        *** list errors ***
  307.  
  308.     Returns the number of entities of the specified class and type in the specified area. To obtain 
  309.     all entities regardless of their class or type pass kCfgAnyEntityClass or kCfgAnyEntityType. If 
  310.     the area doesn’t exist or the wrong id is passed kCfgAreaNotFoundErr is returned.
  311. */
  312.  
  313. /*
  314.     Count as input, is the number of entities to read;
  315.     count as output, receives the actual number of entities or the number you specified. 
  316. */
  317. EXTERN_API( OSStatus )
  318. OTCfgGetEntitiesList            (CfgDatabaseRef         dbRef,
  319.                                  CfgAreaID                 areaID,
  320.                                  CfgEntityClass         entityClass,
  321.                                  CfgEntityType             entityType,
  322.                                  ItemCount *            itemCount,
  323.                                  CfgEntityRef             entityRef[],
  324.                                  CfgEntityInfo             entityInfo[]);
  325.  
  326. /*
  327.     OTCfgGetEntitiesList()
  328.  
  329.     Inputs:        CfgDatabaseRef dbRef            Reference to opened database
  330.                 CfgAreaID areaID                ID of area to list
  331.                 CfgEntityClass entityClass        Class of entities to list
  332.                 CfgEntityType entityType        Type of entities to list
  333.                 ItemCount* itemCount            Count of entities requested
  334.     Outputs:    ItemCount* itemCount            Count of entities listed
  335.     Returns:    OSStatus                        *** list errors ***
  336.  
  337.     Returns the list of entities of the specified class and type in the specified area. To obtain all 
  338.     entities regardless of their class or type pass kCfgAnyEntityClass or kCfgAnyEntityType. The 
  339.     count parameter should have the value obtained by CfgGetEntitiesCount.  On exit count may be less 
  340.     if some entities were deleted in the meantime. The id and info parameters should be arrays large 
  341.     enough to hold count entries. If the area doesn’t exist or the wrong id is passed 
  342.     kCfgAreaNotFoundErr is returned.  The info array contains information about each entity, 
  343.     including its class, type, name and the area of its icon:
  344.  
  345.     struct CfgEntityInfo
  346.     {
  347.         CfgEntityClass        fClass;
  348.         CfgEntityType        fType;
  349.         ConstStr255Param    fName;
  350.         CfgResourceLocator    fIcon;
  351.     };
  352. */
  353. EXTERN_API( OSStatus )
  354. OTCfgCreateEntity                (CfgDatabaseRef         dbRef,
  355.                                  CfgAreaID                 areaID,
  356.                                  const CfgEntityInfo *    entityInfo,
  357.                                  CfgEntityRef *            entityRef);
  358.  
  359. /*
  360.     OTCfgCreateEntity()
  361.  
  362.     Inputs:        CfgDatabaseRef dbRef            Reference to opened database
  363.                 CfgAreaID areaID                ID of area to contain entity
  364.                 CfgEntityInfo* entityInfo        Information that defines the entity
  365.     Outputs:    CfgEntityRef* entityRef            Reference to entity created
  366.     Returns:    OSStatus                        *** list errors ***
  367.  
  368.     Creates a new entity with the specified class, type and name and returns an id for it. If the 
  369.     area doesn’t exist or the wrong id is passed kCfgAreaNotFoundErr is returned. If there is already 
  370.     an entity with the same name kCfgEntityAlreadyExistsErr is returned.
  371. */
  372. EXTERN_API( OSStatus )
  373. OTCfgDeleteEntity                (CfgDatabaseRef         dbRef,
  374.                                  const CfgEntityRef *    entityRef);
  375.  
  376. /*
  377.     OTCfgDeleteEntity()
  378.  
  379.     Inputs:        CfgDatabaseRef dbRef            Reference to opened database
  380.                 CfgEntityRef* entityRef            Reference to entity to delete
  381.     Outputs:    none
  382.     Returns:    OSStatus                        *** list errors ***
  383.  
  384.     Deletes the specified entity. If there is no entity with this id kCfgEntityNotfoundErr is returned
  385. */
  386. EXTERN_API( OSStatus )
  387. OTCfgDuplicateEntity            (CfgDatabaseRef         dbRef,
  388.                                  const CfgEntityRef *    entityRef,
  389.                                  const CfgEntityRef *    newEntityRef);
  390.  
  391. /*
  392.     OTCfgDuplicateEntity()
  393.  
  394.     Inputs:        CfgDatabaseRef dbRef            Reference to opened database
  395.                 CfgEntityRef* entityRef            Reference to entity to duplicate
  396.     Outputs:    CfgEntityRef* newEntityRef        Reference to duplicate entity
  397.     Returns:    OSStatus                        *** list errors ***
  398.  
  399.     Duplicates the specified entity. Both entities should exit. If any entity doesn’t exist 
  400.     kCfgEntityNotFoundErr is returned.
  401. */
  402. EXTERN_API( OSStatus )
  403. OTCfgSetEntityName                (CfgDatabaseRef         dbRef,
  404.                                  const CfgEntityRef *    entityRef,
  405.                                  ConstStr255Param         entityName,
  406.                                  CfgEntityRef *            newEntityRef);
  407.  
  408. /*
  409.     OTCfgSetEntityName()
  410.  
  411.     Inputs:        CfgDatabaseRef dbRef            Reference to opened database
  412.                 CfgEntityRef* entityRef            Reference to entity to duplicate
  413.                 ConstStr255Param entityName        New name for entity
  414.     Outputs:    CfgEntityRef* newEntityRef        Reference to renamed entity
  415.     Returns:    OSStatus                        *** list errors ***
  416.  
  417.     Renames the specified entity. If the entity doesn’t exist kCfgEntityNotfoundErr is returned. If 
  418.     there is already an entity with that name kCfgEntityAlreadyExistsErr is returned.
  419. */
  420. EXTERN_API( void )
  421. OTCfgGetEntityArea                (const CfgEntityRef *    entityRef,
  422.                                  CfgAreaID *            areaID);
  423.  
  424. /*
  425.     OTCfgGetEntityArea()
  426.  
  427.     Inputs:        CfgEntityRef *entityRef            Reference to an entity
  428.     Outputs:    CfgAreaID *areaID                ID of area that contains the entity
  429.     Returns:    none
  430.  
  431.     Returns the area ID associated with the specified entity reference.
  432. */
  433. EXTERN_API( void )
  434. OTCfgGetEntityName                (const CfgEntityRef *    entityRef,
  435.                                  Str255                 entityName);
  436.  
  437. /*
  438.     OTCfgGetEntityName()
  439.  
  440.     Inputs:        CfgEntityRef *entityRef            Reference to an entity
  441.     Outputs:    Str255 entityName                Name of the entity
  442.     Returns:    none
  443.  
  444.     Returns the entity name associated with the specified entity reference.
  445. */
  446. EXTERN_API( void )
  447. OTCfgChangeEntityArea            (CfgEntityRef *            entityRef,
  448.                                  CfgAreaID                 newAreaID);
  449.  
  450. /*
  451.     OTCfgChangeEntityArea()
  452.  
  453.     Inputs:        CfgEntityRef *entityRef            Reference to an entity
  454.                 CfgAreaID newAreaID                ID of area to contain moved entity
  455.     Outputs:    none
  456.     Returns:    none
  457.  
  458.     Changes the area ID associated with the specified entity reference. This effectively moves the 
  459.     entity to a different area.
  460. */
  461. /*    -------------------------------------------------------------------------
  462.     These API calls are for the protocol developers to compare the IDs.
  463.     ------------------------------------------------------------------------- */
  464. /*    -------------------------------------------------------------------------
  465.     For OTCfgIsSameEntityRef
  466.     ------------------------------------------------------------------------- */
  467.  
  468. enum {
  469.     kOTCfgIgnoreArea            = true,
  470.     kOTCfgDontIgnoreArea        = false
  471. };
  472.  
  473. EXTERN_API( Boolean )
  474. OTCfgIsSameEntityRef            (const CfgEntityRef *    entityRef1,
  475.                                  const CfgEntityRef *    entityRef2,
  476.                                  Boolean                 ignoreArea);
  477.  
  478. /*
  479.     OTCfgIsSameEntityRef()
  480.  
  481.     Inputs:        CfgEntityRef* entityRef1        Reference to an entity
  482.                 CfgEntityRef* entityRef2        Reference to another entity
  483.                 Boolean ignoreArea                If true, ignore the area ID
  484.     Outputs:    none
  485.     Returns:    Boolean                            If true, entity references match
  486.  
  487.     Compare two entity references. If ignoreArea is true, and the two entity names are the same, then return 
  488.     true. If ignoreArea is false, then the area IDs must be the same, as well as the entity names 
  489.     must be the same, then can return true.
  490. */
  491. EXTERN_API( Boolean )
  492. OTCfgIsSameAreaID                (CfgAreaID                 areaID1,
  493.                                  CfgAreaID                 areaID2);
  494.  
  495. /*
  496.     OTCfgIsSameAreaID()
  497.  
  498.     Inputs:        CfgAreaID areaID1                ID of an area
  499.                 CfgAreaID areaID2                ID of another area
  500.     Outputs:    none
  501.     Returns:    Boolean                            If true, area IDs match
  502.  
  503.     Compare two area IDs. Return true for matching area IDs, and return false for the different area IDs.
  504. */
  505. /*    -------------------------------------------------------------------------
  506.     Dealing with individual preferences
  507.     ------------------------------------------------------------------------- */
  508. /*    -------------------------------------------------------------------------
  509.     Open Preferences
  510.     if writer = true, GetPrefs and SetPrefs are allowed, else only GetPrefs is allowed.
  511.     ------------------------------------------------------------------------- */
  512. EXTERN_API( OSStatus )
  513. OTCfgOpenPrefs                    (CfgDatabaseRef         dbRef,
  514.                                  const CfgEntityRef *    entityRef,
  515.                                  Boolean                 writer,
  516.                                  CfgEntityAccessID *    accessID);
  517.  
  518. /*
  519.     OTCfgOpenPrefs()
  520.  
  521.     Inputs:        CfgDatabaseRef dbRef            Reference to opened database
  522.                 CfgEntityRef* entityRef            Reference to an entity
  523.                 Boolean writer                If true, open for write
  524.     Outputs:    CfgEntityAccessID* accessID        ID for entity access
  525.     Returns:    OSStatus                        *** list errors ***
  526.  
  527.     Open the specified entity and return the CfgEntityAccessID for the following access of the 
  528.     content of the entity. If writer is true, CfgGetPrefs and CfgSetPrefs are allowed, otherwise only 
  529.     CfgGetPrefs is allowed.
  530. */
  531. EXTERN_API( OSStatus )
  532. OTCfgClosePrefs                    (CfgEntityAccessID         accessID);
  533.  
  534. /*
  535.     OTCfgClosePrefs()
  536.  
  537.     Inputs:        CfgEntityAccessID* accessID        ID for entity to close
  538.     Outputs:    none
  539.     Returns:    OSStatus                        *** list errors ***
  540.  
  541.     Close the entity with the specified CfgEntityAccessID.
  542. */
  543. /*    -------------------------------------------------------------------------
  544.     Get/Set Preferences
  545.  
  546.     Accessing the content of an entity
  547.  
  548.     These API calls are for the protocol developers. It supports multiple records per entity. Each 
  549.     record is identified by the prefsType and the size of the record. The protocol stack will provide 
  550.     the STRUCT to view the content of each record.
  551.     ------------------------------------------------------------------------- */
  552. EXTERN_API( OSStatus )
  553. OTCfgSetPrefs                    (CfgEntityAccessID         accessID,
  554.                                  OSType                 prefsType,
  555.                                  const void *            data,
  556.                                  ByteCount                 length);
  557.  
  558. /*
  559.     OTCfgSetPrefs()
  560.  
  561.     Inputs:        CfgEntityAccessID* accessID        ID of entity to access
  562.                 OSType prefsType                Record type to set
  563.                 void* data                        Address of data
  564.                 ByteCount length                Number of bytes of data
  565.     Outputs:    none
  566.     Returns:    OSStatus                        *** list errors ***
  567.  
  568.     Write the data to the specified record. The record is identified by the prefsType. If the entity 
  569.     is not opened for the writer, an error code is returned.
  570. */
  571. EXTERN_API( OSStatus )
  572. OTCfgGetPrefs                    (CfgEntityAccessID         accessID,
  573.                                  OSType                 prefsType,
  574.                                  void *                    data,
  575.                                  ByteCount                 length);
  576.  
  577. /*
  578.     OTCfgGetPrefs()
  579.  
  580.     Inputs:        CfgEntityAccessID* accessID        ID of entity to access
  581.                 OSType prefsType                Record type to get
  582.                 void* data                        Address for data
  583.                 ByteCount length                Number of bytes of data requested
  584.     Outputs:    none
  585.     Returns:    OSStatus                        *** list errors ***
  586.  
  587.     Read the data from the specified record to the passed buffer. The record is identified by the 
  588.     prefsType. If the passed buffer is too small, kCfgDataTruncatedErr is returned, but will copy as 
  589.     many data as possible to the buffer.
  590. */
  591. EXTERN_API( OSStatus )
  592. OTCfgGetPrefsSize                (CfgEntityAccessID         accessID,
  593.                                  OSType                 prefsType,
  594.                                  ByteCount *            length);
  595.  
  596. /*
  597.     OTCfgGetPrefsSize()
  598.  
  599.     Inputs:        CfgEntityAccessID* accessID        ID of entity to access
  600.                 OSType prefsType                Record type to get
  601.                 ByteCount length                Number of bytes of data available
  602.     Outputs:    none
  603.     Returns:    OSStatus                        *** list errors ***
  604.  
  605.     Returns the length, in bytes, of the specified record. The record is identified by the prefsType.
  606. */
  607. /*    -------------------------------------------------------------------------
  608.     Get table of contents for prefs
  609.     ------------------------------------------------------------------------- */
  610. EXTERN_API( OSStatus )
  611. OTCfgGetPrefsTOCCount            (CfgEntityAccessID         accessID,
  612.                                  ItemCount *            itemCount);
  613.  
  614. /*
  615.     OTCfgGetPrefsTOCCount()
  616.  
  617.     Inputs:        CfgEntityAccessID* accessID        ID of entity to access
  618.     Outputs:    ItemCount* itemCount            Number of entries available
  619.     Returns:    OSStatus                        *** list errors ***
  620.  
  621.     Get the count of all the record headers in the entity. Return the number of records in the count. 
  622. */
  623. EXTERN_API( OSStatus )
  624. OTCfgGetPrefsTOC                (CfgEntityAccessID         accessID,
  625.                                  ItemCount *            itemCount,
  626.                                  CfgPrefsHeader         PrefsTOC[]);
  627.  
  628. /*
  629.     OTCfgGetPrefsTOC()
  630.  
  631.     Inputs:        CfgEntityAccessID* accessID        ID of entity to access
  632.                 ItemCount* itemCount            Number of entries requested
  633.     Outputs:    ItemCount* itemCount            Number of entries available
  634.                 CfgPrefsHeader PrefsTOC[]        Table of entries
  635.     Returns:    OSStatus                        *** list errors ***
  636.  
  637.     Get the list of all the record headers in the entity. Return the number of records in the count. 
  638.     If the PrefsTOC is specified, it has to be big enough to hold all the record headers. If the 
  639.     PrefsTOC is null, only the count is returned.
  640. */
  641. EXTERN_API( Handle )
  642. OTCfgGetDefault                    (ResType                 entityType,
  643.                                  ResType                 entityClass,
  644.                                  ResType                 recordType);
  645.  
  646.  
  647. #if PRAGMA_STRUCT_ALIGN
  648.     #pragma options align=reset
  649. #elif PRAGMA_STRUCT_PACKPUSH
  650.     #pragma pack(pop)
  651. #elif PRAGMA_STRUCT_PACK
  652.     #pragma pack()
  653. #endif
  654.  
  655. #ifdef PRAGMA_IMPORT_OFF
  656. #pragma import off
  657. #elif PRAGMA_IMPORT
  658. #pragma import reset
  659. #endif
  660.  
  661. #ifdef __cplusplus
  662. }
  663. #endif
  664.  
  665. #endif /* __NETWORKSETUP__ */
  666.  
  667.